﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Common;

namespace OnlineDealer
{
    public partial class OnlineDealer
    {
        public void DoFold()
        {
            handData.Actions.Add(new PlayerAction { PlayerId = G.FuxiPlayerID, Round = CurrentInfo.Round, Type = ActionType.Fold });
            DelayBeforeAction();
            table.BringWindowToFront();
            SendKeys.SendWait("{F1}");
        }
        public void DoCheck()
        {
            handData.Actions.Add(new PlayerAction { PlayerId = G.FuxiPlayerID, Round = CurrentInfo.Round, Type = ActionType.Check });
            DelayBeforeAction();
            table.BringWindowToFront();
            SendKeys.SendWait("{F2}");
        }

        public void DoCall()
        {
            handData.Actions.Add(new PlayerAction { PlayerId = G.FuxiPlayerID, Round = CurrentInfo.Round, Type = ActionType.Call });
            DelayBeforeAction();
            table.BringWindowToFront();
            SendKeys.SendWait("{F2}");
        }

        public void DoRaise()
        {
            handData.Actions.Add(new PlayerAction { PlayerId = G.FuxiPlayerID, Round = CurrentInfo.Round, Type = ActionType.Raise });
            DelayBeforeAction();
            table.BringWindowToFront();
            SendKeys.SendWait("{F3}");
        }
        private void DelayBeforeAction()
        {
            int time = rand.Next(1800);
            Thread.Sleep(time);
        }
    }
}
